home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.atlanta.com!not-for-mail
- From: curts@compgen.com (Curt Smith)
- Newsgroups: comp.lang.c++,comp.protocols.tcp-ip
- Subject: Re: Socket classes and fork()
- Followup-To: comp.lang.c++,comp.protocols.tcp-ip
- Date: 16 Jan 1996 19:11:30 GMT
- Organization: Internet Atlanta
- Message-ID: <4dgt92$o7e@nntp.atlanta.com>
- References: <1996Jan15.192235.21245@etnibsd.uucp>
- NNTP-Posting-Host: gw1.compgen.com
- X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]
-
- Sandeep Pathak (sandeep@etnibsd.uucp) wrote:
- : Hi netters,
- : My apologies if this is a repost. I wasnt sure my first posting went thru.
- : I am writing simple C++ classes/wrappers for sockets and related
- : networking abstractions. I have modeled my classes mostly on the
- : traditional structures and function calls, but I got stumped by "fork()".
- : My Socket class also has a reference count similar to that maintained
- : by the kernel for a socket descriptor. But how do I maintain this count
- : if a fork() is done? I can not think of anyway of maintaining
- : consistency w/ the kernel count unless there is some parent <-> child
- : IPC for the Socket object. Anybody want to share some experiences?..
- : I am sure there are a lot of people who have written/dealt w/ C++
- : wrappers for IPC and networking.
- : At this point (without some research) I would lamely contend that my
- : Socket abstraction will not be in a proper state if concurrent servers
- : are written w/ it.
- : Please prove me wrong..!
-
- You are correct. Although tools like; fuser, and lsof access the
- per process and kernel data structures to sniff all PIDs that have
- an fd open. You can code the same, to snoop, for other PIDs with this
- fd. It is a pain and is CPU and real time expensive to open and
- prob /proc/* or /dev/kmem and largely this code will be OS dependant.
-
- --
-
- Curt Smith
- curts@compgen.com
-
-